//
//  ColorMacros.h
//  ACE
//
//  Created by Mickey Yin on 2021/12/1.
//

#ifndef ColorMacros_h
#define ColorMacros_h


//RGB格式
#define rgb(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
//RGBA格式 （A：alpha）
#define rgba(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:a]

//试图默认背景色
#define RGBGlobal   rgba(244, 245, 247, 1)
#define RGBGlobal333 rgba(51, 51, 51, 1)
#define RGBGlobal666 rgba(102, 102, 102, 1)


//随机色生成
#define kRandomColor KRGBColor(arc4random_uniform(256)/255.0,arc4random_uniform(256)/255.0,arc4random_uniform(256)/255.0)

//十六进制色值
#define kColorWithHex(rgbValue) \
        [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 \
        green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 \
        blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:1.0]

//十六进制色值,有透明度
#define kColorWithHexWithTransparent(rgbValue,transparentValue) [UIColor \
        colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
        green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
        blue:((float)(rgbValue & 0xFF))/255.0 alpha:transparentValue]

#define JXBUIColorFromRGBA(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]

#define JXBUIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1]

#endif /* ColorMacros_h */
